#!/usr/bin/env python

import wx

import __viewer as viewer
from .._frame import Frame

class Viewer(Frame):
    
    def __init__(self, parent=None):
        super(Viewer, self).__init__(parent, name='Frame')
        
        self.ToolBar = viewer.ToolBar(self)
        self.ToolBar.Realize()
        self.StatusBar = wx.StatusBar(self)
        
        self.realize()
        
    def realize(self):
        panel = wx.Panel(self)
        
        self.canvas = viewer.Canvas(panel)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.canvas, 1, wx.GROW)
        panel.SetSizer(sizer)
        
    @property
    def status(self):
        return self.StatusBar.StatusText
    
    @status.setter
    def status(self, value):
        self.StatusBar.SetStatusText('%s' % value)